home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / gplot3_2.lha / gnuplot / term / object.h < prev    next >
Text File  |  1992-03-25  |  5KB  |  229 lines

  1. /*
  2.  * $Id: object.h,v 3.26 92/03/24 22:35:34 woo Exp Locker: woo $
  3.  */
  4.  
  5. /* 
  6.  *    FIG : Facility for Interactive Generation of figures
  7.  *
  8.  *    (c) copy right 1985 by Supoj Sutanthavibul (supoj@sally.utexas.edu)
  9.  *      January 1985.
  10.  *    1st revision : Aug 1985.
  11.  *    2nd revision : Feb 1988.
  12.  *
  13.  *    %W%    %G%
  14. */
  15. #define                    DEFAULT            -1
  16.  
  17. typedef        struct f_pattern {
  18.             int            w, h;
  19.             int            *p;
  20.             }
  21.         F_pattern;
  22.  
  23. typedef        struct f_pen {
  24.             int            x, y;
  25.             int            *p;
  26.             }
  27.         F_pen;
  28.  
  29. typedef        struct f_point {
  30.             int            x, y;
  31.             struct f_point        *next;
  32.             }
  33.         F_point;
  34.  
  35. typedef        struct f_pos {
  36.             int            x, y;
  37.             }
  38.         F_pos;
  39.  
  40. typedef        struct f_arrow {
  41.             int            type;
  42.             int            style;
  43.             float            thickness;
  44.             float            wid;
  45.             float            ht;
  46.             }
  47.         F_arrow;
  48.  
  49. typedef        struct f_ellipse {
  50.             int            type;
  51. #define                    T_ELLIPSE_BY_RAD    1
  52. #define                    T_ELLIPSE_BY_DIA    2
  53. #define                    T_CIRCLE_BY_RAD        3
  54. #define                    T_CIRCLE_BY_DIA        4
  55.             int            style;
  56.             int            thickness;
  57.             int            color;
  58. #define                    BLACK            0
  59.             int            depth;
  60.             int            direction;
  61.             float            style_val;
  62.             float            angle;
  63.             struct f_pen        *pen;
  64.             struct f_pattern    *area_fill;
  65. #define                           UNFILLED    (F_pattern *)0
  66. #define                           BLACK_FILL    (F_pattern *)1
  67. #define                           DARK_GRAY_FILL    (F_pattern *)2
  68. #define                           MED_GRAY_FILL    (F_pattern *)3
  69. #define                           LIGHT_GRAY_FILL    (F_pattern *)4
  70. #define                           WHITE_FILL    (F_pattern *)4
  71.             struct f_pos        center;
  72.             struct f_pos        radiuses;
  73.             struct f_pos        start;
  74.             struct f_pos        end;
  75.             struct f_ellipse    *next;
  76.             }
  77.         F_ellipse;
  78.  
  79. typedef        struct f_arc {
  80.             int            type;
  81. #define                    T_3_POINTS_ARC        1
  82.             int            style;
  83.             int            thickness;
  84.             int            color;
  85.             int            depth;
  86.             struct f_pen        *pen;
  87.             struct f_pattern    *area_fill;
  88.             float            style_val;
  89.             int            direction;
  90.             struct f_arrow        *for_arrow;
  91.             struct f_arrow        *back_arrow;
  92.             struct {float x, y;}    center;
  93.             struct f_pos        point[3];
  94.             struct f_arc        *next;
  95.             }
  96.         F_arc;
  97.  
  98. typedef        struct f_line {
  99.             int            type;
  100. #define                    T_POLYLINE    1
  101. #define                    T_BOX        2
  102. #define                    T_POLYGON    3
  103.             int            style;
  104.             int            thickness;
  105.             int            color;
  106.             int            depth;
  107.             float            style_val;
  108.             struct f_pen        *pen;
  109.             struct f_pattern    *area_fill;
  110.             struct f_arrow        *for_arrow;
  111.             struct f_arrow        *back_arrow;
  112.             struct f_point        *points;
  113.             struct f_line        *next;
  114.             }
  115.         F_line;
  116.  
  117. typedef        struct f_text {
  118.             int            type;
  119. #define                    T_LEFT_JUSTIFIED    0
  120. #define                    T_CENTER_JUSTIFIED    1
  121. #define                    T_RIGHT_JUSTIFIED    2
  122.             int            font;
  123. #define                    DEFAULT_FONT        0
  124. #define                    ROMAN_FONT        1
  125. #define                    BOLD_FONT        2
  126. #define                    ITALIC_FONT        3
  127. #define                    MODERN_FONT        4
  128. #define                    TYPEWRITER_FONT        5
  129.             int            size;    /* point size */
  130.             int            color;
  131.             int            depth;
  132.             float            angle;    /* in radian */
  133.             int            style;
  134. #define                    PLAIN        1
  135. #define                    ITALIC        2
  136. #define                    BOLD        4
  137. #define                    OUTLINE        8
  138. #define                    SHADOW        16
  139.             int            height;    /* pixels */
  140.             int            length;    /* pixels */
  141.             int            base_x;
  142.             int            base_y;
  143.             struct f_pen        *pen;
  144.             char            *cstring;
  145.             struct f_text        *next;
  146.             }
  147.         F_text;
  148.  
  149. typedef        struct f_control {
  150.             float            lx, ly, rx, ry;
  151.             struct f_control    *next;
  152.             }
  153.         F_control;
  154.  
  155. #define        int_spline(s)        (s->type & 0x2)
  156. #define        normal_spline(s)    (!(s->type & 0x2))
  157. #define        closed_spline(s)    (s->type & 0x1)
  158. #define        open_spline(s)        (!(s->type & 0x1))
  159.  
  160. typedef        struct f_spline {
  161.             int            type;
  162. #define                    T_OPEN_NORMAL        0
  163. #define                    T_CLOSED_NORMAL        1
  164. #define                    T_OPEN_INTERPOLATED    2
  165. #define                    T_CLOSED_INTERPOLATED    3
  166.             int            style;
  167.             int            thickness;
  168.             int            color;
  169.             int            depth;
  170.             float            style_val;
  171.             struct f_pen        *pen;
  172.             struct f_pattern    *area_fill;
  173.             struct f_arrow        *for_arrow;
  174.             struct f_arrow        *back_arrow;
  175.             /*
  176.             For T_OPEN_NORMAL and T_CLOSED_NORMAL points
  177.             are control points while they are knots for
  178.             T_OPEN_INTERPOLATED and T_CLOSED_INTERPOLTED
  179.             whose control points are stored in controls.
  180.             */
  181.             struct f_point        *points;
  182.             struct f_control    *controls;
  183.             struct f_spline        *next;
  184.             }
  185.         F_spline;
  186.  
  187. typedef        struct f_compound {
  188.             struct f_pos        nwcorner;
  189.             struct f_pos        secorner;
  190.             struct f_line        *lines;
  191.             struct f_ellipse    *ellipses;
  192.             struct f_spline        *splines;
  193.             struct f_text        *texts;
  194.             struct f_arc        *arcs;
  195.             struct f_compound    *compounds;
  196.             struct f_compound    *next;
  197.             }
  198.         F_compound;
  199.  
  200. #define        ARROW_SIZE        sizeof(struct f_arrow)
  201. #define        POINT_SIZE        sizeof(struct f_point)
  202. #define        CONTROL_SIZE        sizeof(struct f_control)
  203. #define        ELLOBJ_SIZE        sizeof(struct f_ellipse)
  204. #define        ARCOBJ_SIZE        sizeof(struct f_arc)
  205. #define        LINOBJ_SIZE        sizeof(struct f_line)
  206. #define        TEXOBJ_SIZE        sizeof(struct f_text)
  207. #define        SPLOBJ_SIZE        sizeof(struct f_spline)
  208. #define        COMOBJ_SIZE        sizeof(struct f_compound)
  209.  
  210. /**********************  object codes  **********************/
  211.  
  212. #define        O_ELLIPSE        1
  213. #define        O_POLYLINE        2
  214. #define        O_SPLINE        3
  215. #define        O_TEXT            4
  216. #define        O_ARC            5
  217. #define        O_COMPOUND        6
  218. #define        O_END_COMPOUND        -O_COMPOUND
  219. #define        O_ALL_OBJECT        99
  220.  
  221. /************  object styles (except for f_text)  ************/
  222.  
  223. #define        SOLID_LINE        0
  224. #define        DASH_LINE        1
  225. #define        DOTTED_LINE        2
  226.  
  227. #define        CLOSED_PATH        0
  228. #define        OPEN_PATH        1
  229.